/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package mobiqueen.googlemaps;

import android.graphics.drawable.Drawable;
import android.os.Bundle;
import com.google.android.maps.*;

import java.util.List;
/**
 *
 * @author jv
 */
public class Googlemaps extends MapActivity  {

    private MapView mMapView;
    private List<Overlay> mMapOverlays;

    @Override
    public void onCreate(Bundle savedInstanceState)
    {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
  
       initializeMap();
       initializeMapItems();
    }

    private void initializeMap(){
        mMapView = (MapView) findViewById(R.id.mapview);
        mMapView.setBuiltInZoomControls(true);
        mMapOverlays = mMapView.getOverlays();
    }
    
    private void initializeMapItems(){
        addMapOverlayItem(this.getResources().getDrawable(R.drawable.androidmarker),
                          new GeoPoint(19240000,-99120000),
                          "Hola, Mundo!",
                          "I'm in Mexico City!");

        addMapOverlayItem(this.getResources().getDrawable(R.drawable.androidmarker),
                          new GeoPoint(51805245,4662130),
                          "Welkom",
                          "Tostihuis jan");
    }

    public void addMapOverlayItem(Drawable drawable, GeoPoint point, String text1, String text2)
    {
        GoogleMapItems itemizedoverlay = new GoogleMapItems(drawable);
        OverlayItem overlayitem = new OverlayItem(point, text1, text2);
        itemizedoverlay.addOverlay(overlayitem);
        mMapOverlays.add(itemizedoverlay);
    }

    @Override
    protected boolean isRouteDisplayed()
    {
        return false;
    }

}
